package cz.cvut.fit.mi_paa.knapsack;

/**
 * Created with IntelliJ IDEA.
 * User: milos
 * Date: 28.9.12
 * Time: 0:08
 * To change this template use File | Settings | File Templates.
 */
public class Item {

    private int price;
    private int weight;
    private int index;
    private int shiftedPrice;


    public Item(int weight,int price,int index) {
        this.price = price;
        this.weight = weight;
        this.index= index;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public double getRatio() {
        return (double) price / (double) weight;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public void setNumOfLsb(int numOfLsb) {
        this.shiftedPrice = price >> numOfLsb;
    }

    public int getShiftedPrice() {
        return shiftedPrice;
    }
}
